package cn.yuanqiao.es.service;

import java.util.List;
import java.util.Map;

/**
 * @description: 索引结构基础方法接口
 * @author: X-Pacific zhang
 * @create: 2019-01-25 16:52
 **/
public interface ElasticsearchIndex {
    /**
     * 创建索引
     *
     * @param
     * @throws Exception
     */
    boolean createIndex(String indexName);

    /**
     * 批量保存索引数据数据
     *
     * @param
     * @return boolean
     * @author hbWang
     * @date 2023/6/11 11:38
     */
    boolean insertDocList(List<Map<String, Object>> maps, String indexName);


    /**
     * 单条保存索引数据
     *
     * @param
     * @return boolean
     * @author hbWang
     * @date 2023/6/25 17:41
     */
    boolean insertDoc(Map<String, Object> map, String indexName);

    /**
     * 删除索引
     *
     * @throws Exception
     */
    boolean dropIndex(String indexName);

    /**
     * 删除文档信息
     *
     * @param ids
     * @param indexName
     * @return
     */
    boolean dropDoc(List<String> ids, String indexName);

    /**
     * 判断索引是否存在
     *
     * @return
     * @throws
     */
    boolean existsIndex(String indexName);

}
